package com.example.javaee_library.Service;

import com.example.javaee_library.Entity.Book;
import com.example.javaee_library.dto.AppointExecution;


import java.sql.Timestamp;
import java.util.List;

/**
 * 业务接口：站在"使用者"角度设计接口 三个方面：方法定义粒度，参数，返回类型（return 类型/异常）
 */
public interface Book_Service {

    /**
     * 查询一本图书
     *
     * @param bookId
     * @return
     */
    Book getById(long bookId);

    /**
     * 查询所有图书
     *
     * @return
     */
    List<Book> getList();

    /**
     * 预约图书
     *
     * @param bookId
     * @param studentId
     * @return
     */
    AppointExecution appoint(long bookId, long studentId);

    /*/**
    * @Description: 插入图书
    * @Param: [bookId, bookName, bookNum]
    * @return: [bookId, bookName, bookNum]
    * @Author: Miao
    * @Date: 2021/12/
    */
    boolean AddBook(int bookId, String bookName, int bookNum);

    /*/**
    * @Description: 修改图书
    * @Param:
    * @return:
    * @Author: Miao
    * @Date: 2021/12/
    */
    boolean Updatebook(int bookId, String bookName, int bookNum);
    /*/**
    * @Description: 还书
    * @Param:
    * @return:
    * @Author: Miao
    * @Date: 2021/12/
    */
    boolean returnBook(int bookId,int studentId);

    /*/**
    * @Description: 查询书籍
    * @Param:
    * @return:
    * @Author: Miao
    * @Date: 2021/12/
    */
    List<Book> Serach(String bookName);

    /*/**
    * @Description: 续借
    * @Param:
    * @return:
    * @Author: Miao
    * @Date: 2021/12/
    */
    int appoint_again(long bookId, long studentId, Timestamp timestamp);

}
